#! /usr/bin/env python
# -*- coding:utf-8 -*-
# Author Jmz


class MyError(BaseException):
    def __init__(self,msg,user):
        super().__init__()
        self.msg = msg
        self.user = user
    def __str__(self):  # 将对象直接作为变量使用时，触发
        return '<%s : %s>'%(self.user,self.msg)

raise MyError('这是一个错误','jmz')

